<#import "base.ftl" as base/>
<#import "spring.ftl" as spring/>

<@base.baseTemplate title="usermanagement">
	<a class="button" href="${rc.getContextPath()}/user/0"><@spring.message "new_user" /></a>
	<div class="line">
		<table class="ui-widget">
			<thead class="ui-widget-header">
				<tr>
			  		<th style="width: 150px"><@spring.message "loginName"/></th>
			  		<th style="width: 150px"><@spring.message "firstName"/></th>
			  		<th style="width: 150px"><@spring.message "lastName"/></th>
			  		<th style="width: 60px"><@spring.message "enabled"/></th>
			  		<th style="width: 150px"><@spring.message "role"/></th>
			  		<th></th>
			  	</tr>
			</thead>
			<tbody class="ui-widget-content">
			  	<#list user_list as user>
			  		<tr>
					  	<td><a href="${rc.getContextPath()}/user/${user.id}">${user.loginName}</a></td>
					  	<td>${user.firstName}</td>
					  	<td>${user.lastName}</td>
					  	<td><#if user.enabled?string("yes", "no")! == "yes"><@spring.message "yes"/><#else><@spring.message "no"/></#if></td>
					  	<td>${user.userRole.name}</td>
					  	<td><a href="${rc.getContextPath()}/user/${user.id}?delete"><@spring.message "delete"/></a></td>
			  		</tr>
				</#list>
			</tbody>
		</table>
	</div>
</@base.baseTemplate>